<?php
    if (($_REQUEST['r']==$login_page) && ($_REQUEST['action']=="LOGIN")){
        if (chekUsernamePassword($_REQUEST['username'], $_REQUEST['password'])){
            $_SESSION['username'] = trim($_REQUEST['username']);
            die();
        }
    }
    
    if ($_REQUEST['r']=="") {
        $resource_next = "0002"; // Welcome page
    } else {
        $resource_next = $_REQUEST['r'];
    }
    
    $Skinner=new Skinner();
    $Skinner->setSkin($skins_path."login");
    $Skinner->registerVariable("files_path", $files_path);    
    $Skinner->registerVariable("resource_next",$resource_next);
    $Skinner->registerVariable("admin_root", $admin_root);
    $Skinner->registerVariable("lbl_ask_for_login", $labels["LBL_ASK_FOR_LOGIN"]);
    $Skinner->registerVariable("lbl_user", $labels["LBL_USER"]);
    $Skinner->registerVariable("lbl_password", $labels["LBL_PASSWORD"]);
    $Skinner->registerVariable("lbl_ok", $labels["LBL_OK"]);
    $content=$Skinner->doSubstitution_FAST();

?>